﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Linq;
using Excel = Microsoft.Office.Interop.Excel;
using Office = Microsoft.Office.Core;
using Join;

namespace Join2007
{
    public partial class ThisAddIn
    {
        private Microsoft.Office.Tools.CustomTaskPane JoinPane = null; 

        private void ThisAddIn_Startup(object sender, System.EventArgs e)
        {
        }

        private void ThisAddIn_Shutdown(object sender, System.EventArgs e)
        {
            RemoveJoinTaskPane();
        }

        protected override Microsoft.Office.Core.IRibbonExtensibility CreateRibbonExtensibilityObject()
        {
            return new Ribbon1();
        }

        //http://msdn2.microsoft.com/en-us/library/aa722570.aspx#creatingcustomtaskpanes_usingtheribbon
        public void AddJoinTaskPane()
        {
            JoinPane = this.CustomTaskPanes.Add(new JoinControl(), "Join");
            JoinPane.Visible = true;
        }

        public void RemoveJoinTaskPane()
        {
            if (null != JoinPane)
            {
                this.CustomTaskPanes.Remove(JoinPane);
            }
        }



        #region VSTO generated code

        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InternalStartup()
        {
            this.Startup += new System.EventHandler(ThisAddIn_Startup);
            this.Shutdown += new System.EventHandler(ThisAddIn_Shutdown);
        }
        
        #endregion
    }
}
// Microsoft Research, eScience Research Group, Microsoft Public License (Ms-PL)
// Copyright (c) Microsoft Corporation. All rights reserved. 